<MDXHeader
  title="Context Menu"
  description="Displays a menu located at the pointer, triggered by a right-click or a long-press."
  docs="https://kobalte.dev/docs/core/components/context-menu"
/>

<ComponentPreview name="context-menu-demo" />

## Installation

<Tabs defaultValue="cli">

<TabsList>
  <TabsTrigger value="cli">CLI</TabsTrigger>
  <TabsTrigger value="manual">Manual</TabsTrigger>
</TabsList>

<TabsContent value="cli">

```bash
npx solidui-cli@latest add context-menu
```

</TabsContent>

<TabsContent value="manual">
<Steps>

<Step>Install the following dependencies: </Step>

```bash
npm install @kobalte/core
```

<Step>Copy and paste the following code into your project: </Step>

<ComponentSource name="context-menu" />

</Steps>
</TabsContent>

</Tabs>

## Usage

```tsx
import {
  ContextMenu,
  ContextMenuContent,
  ContextMenuItem,
  ContextMenuLabel,
  ContextMenuSeparator,
  ContextMenuTrigger
} from "~/components/ui/context-menu"
```

```tsx
<ContextMenu>
  <ContextMenuTrigger>Open</ContextMenuTrigger>
  <ContextMenuContent>
    <ContextMenuLabel>My Account</ContextMenuLabel>
    <ContextMenuSeparator />
    <ContextMenuItem>Profile</ContextMenuItem>
    <ContextMenuItem>Billing</ContextMenuItem>
    <ContextMenuItem>Team</ContextMenuItem>
    <ContextMenuItem>Subscription</ContextMenuItem>
  </ContextMenuContent>
</ContextMenu>
```
